During digital video data transmitting, especially in real time transmitting, as well as in storing such data, the amount of raw video data tends to be rather large and thus needs to be compressed by data compression and coding processes. Standards for video coding have been developed since the 1990s starting from MPEG-1, MPEG-2 and H.261, H.263 to the H.264 as the present standard. H.264 is an international standard for digital video compression newly developed by the Joint Video Team (JVT), which is co-founded by the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG). The H.264 standard can provide a better quality in video transmission with lower bandwidth, which has brought the video compression technique into a higher level. The applications of H.264 have gradually spread into many fields, such as low code rate wireless transmission, standard definition and high definition TV broadcasting, Internet Video Streaming, high definition DVD video transmission, high quality digital camera video, etc.
Intra prediction is an important part of the video compression technique in the H.264 standard. In H.264, the video is comprised of images with multiple frames. Each frame of the image can be divided into a plurality of macroblocks (“MBs”). Intra prediction is performed on one single macroblock, uses available pixels of neighboring data blocks to predict the pixel value in the current data block in different directions, and encodes and stores the difference between the real pixel value and the predicted pixel value of the current data block. The method is unique to the H.264 standard and especially useful in the flat background or parallel lines of an image where spatial redundancy often exists.
In the H.264 standard, there are four intra prediction types of blocks: I4×4, I8×8, I16×16 luma blocks and 8×8 chroma blocks. There are nine prediction modes for I4×4 and I8×8 blocks, i.e., Vertical (V), Horizontal (H), DC, Diagonal_Down_Left, Diagonal_Down_Right, Vertical_Right, Horizontal_Down, Vertical_Left, and Horizontal_Up. FIG. 1 uses I4×4 block as an example to show the nine prediction modes. Specifically, A to M denotes the neighboring pixels of a current block undergoing intra prediction; grey area indicates the pixels of current block to be predicted. Regarding I16×16 block and chroma blocks, there are only four prediction modes: Vertical, Horizontal, DC, and Plane mode. Among these modes, Vertical, Horizontal, and DC modes are the same as those for I4×4 block. The H.264 standard provides methods and equations for calculating the predicted pixel values for every single mode of block in all different sizes. For example, for a I4×4 block with the prediction mode of Diagonal_Down_Left, the value of the prediction pixel Predictor4x4L[x, y], with x, y=0 . . . 3 are derived as follows:
If x is equal to 3 and y is equal to 3,Predictor4x4L[x,y]=(P[6,−1]+3*P[7,−1]+2)>>2
Otherwise (x is not equal to 3 or y is not equal to 3),Predictor4x4L[x,y]=(P[x+y,−1]+2*P[x+y+1,−1]+P[x+y+2,−1]+2)>>2wherein P[m,n] denotes the values of neighboring pixels of the current block to be predicted, m=−1, . . . , 7, denotes the locations of the neighboring pixels M, A, B, C, D, E, F, G and H as shown in FIG. 1, respectively, and n=−1, . . . , 3, denotes the locations of the neighboring pixels I, J, K and L as shown in FIG. 1, respectively.
To start an intra prediction process, as for a divided block, according to the size of the block and the prediction mode, corresponding equations given in the H.264 standard are chosen to calculate predicted pixel values, and then the calculated pixel values are selected according to a predetermined mode and assigned to the current prediction block. It can be seen from above that the amount of computation in the intra prediction process is very large. In existing designs, a datapath having a single form is usually utilized to do the computation for all prediction modes. Such a datapath can only calculate one predicted pixel once, thus the efficiency is quite low. If calculation for multiple predicted pixels at one time is desired, which mean enlarging the bandwidth of the datapath, the only way is to assign such a datapath for each predicted pixel, which will cause a large chip real estate area cost and yield a large amount of redundant circuit units. Moreover, most of the equations in calculating the predicted pixel in H.264 standard are the same for different blocks/prediction modes, therefore, the existing designs will produce a large amount of redundant computation, and thereby decrease the computational efficiency.